package com.xiyou.luckdraw.api.dto.order;

import com.xiyou.luckdraw.common.result.AbstractRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @ClassName: OrderInfoListRequest
 * @Description: 订单列表查询请求参数
 * @author: limingxing
 * @Date: 2019-10-09 21:08
 */
@Data
@ApiModel(value = "查询订单列表请求参数")
public class OrderInfoListRequest extends AbstractRequest {
    @ApiModelProperty(value = "昵称")
    private String nickName;
 //   @ApiModelProperty(value = "用户ID",required = false)
    private Long userId;
  //  @ApiModelProperty(value = "订单号")
    private Long orderNo;
    @ApiModelProperty(value = "页码",example = "1")
    private Integer page;
    @ApiModelProperty(value = "页大小",example = "10")
    private Integer size;

    private Integer orderStatus;

    private String startTime;
    private String endTime;

    @ApiModelProperty(value = "排序参数(price,payTime)")
    private String sortField;
    @ApiModelProperty(value = "排序方式(DESC,ASC)")
    private String sort;


    @Override
    public void requestCheck() {
        if(page == null || page < 1){
            page = 1;
        }
        if(size == null || size < 1){
            size = 10;
        }
    }
}
